/**
 * @author furthurr
 */
var win = Titanium.UI.currentWindow;
win.backgroundColor = 'pink';
var penales= Titanium.UI.createButton({
	title:'Ciencias Penales',
	top:150,
	bottom:280,	
	left:20,
	right:130	
});
var derEmp= Titanium.UI.createButton({
	title:'Derecho de Empresa',
	top:190,
	bottom:240,	
	left:20,
	right:130	
});
var amparo= Titanium.UI.createButton({
	title:'Constitucional y Amparo',
	top:230,
	bottom:200,	
	left:20,
	right:130	
});
var derCiv= Titanium.UI.createButton({
	title:'Derecho Procesal Civil',
	top:270,
	bottom:160,	
	left:20,
	right:130	
});
var derFiscal= Titanium.UI.createButton({
	title:'Derecho Fiscal',
	top:310,
	bottom:120,	
	left:20,
	right:130	
});
var bclose = Titanium.UI.createButton({
	title:'cerrar',
	top:350,
	bottom:80,
	left:20,
	right:130
});


win.add(penales);
win.add(derEmp);
win.add(amparo);
win.add(derCiv);
win.add(derFiscal);
win.add(bclose);
bclose.addEventListener('click', function (e){
	var Menu = Titanium.UI.createWindow({
		url:'../appMaestrias.js'
	});
	Menu.open({transition:Ti.UI.iPhone.AnimationStyle.CURL_DOWN});
});

penales.addEventListener('click', function (e){
	Titanium.API.info("Abriendo Ciencias Penales");
	var w = Ti.UI.createWindow({
		backgroundColor:'white',
		url:'appPenales.js'
				
	});
            var b = Titanium.UI.createButton({
                title:'Close',
                style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN
            });
            w.setLeftNavButton(b);
            b.addEventListener('click',function()
            {
                w.close();
            });
            w.open({modal:true});
       
});

derEmp.addEventListener('click', function (e){
	Titanium.API.info("Abriendo Derecho de Empresa ");
	var w = Ti.UI.createWindow({
		backgroundColor:'white',
		url:'appDerEmp.js'
				
	});
            var b = Titanium.UI.createButton({
                title:'Close',
                style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN
            });
            w.setLeftNavButton(b);
            b.addEventListener('click',function()
            {
                w.close();
            });
            w.open({modal:true});
       
});
amparo.addEventListener('click', function (e){
	Titanium.API.info("Abriendo Constitucional y Amparo");
	var w = Ti.UI.createWindow({
		backgroundColor:'white',
		url:'appAmparo.js'
				
	});
            var b = Titanium.UI.createButton({
                title:'Close',
                style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN
            });
            w.setLeftNavButton(b);
            b.addEventListener('click',function()
            {
                w.close();
            });
            w.open({modal:true});
       
});
derCiv.addEventListener('click', function (e){
	Titanium.API.info("Abriendo Derecho Procesal Civil ");
	var w = Ti.UI.createWindow({
		backgroundColor:'white',
		url:'appDerCiv.js'
				
	});
            var b = Titanium.UI.createButton({
                title:'Close',
                style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN
            });
            w.setLeftNavButton(b);
            b.addEventListener('click',function()
            {
                w.close();
            });
            w.open({modal:true});
       
});
derFiscal.addEventListener('click', function (e){
	Titanium.API.info("Abriendo Derecho Fiscal");
	var w = Ti.UI.createWindow({
		backgroundColor:'white',
		url:'appDerFiscal.js'
				
	});
            var b = Titanium.UI.createButton({
                title:'Close',
                style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN
            });
            w.setLeftNavButton(b);
            b.addEventListener('click',function()
            {
                w.close();
            });
            w.open({modal:true});
       
});
